package com.smsc.headend.task.engine.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smsc.headend.module.data.entity.MapDdsMdmWf;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface MapDdsMdmWfMapper extends BaseMapper<MapDdsMdmWf> {
    @Select("SELECT SUB_DATA_ITEM_ID,LP_DATA_ITEM_ID,MDM_DATA_TYPE_ID,MDM_DATA_TYPE_NAME,MDM_DATA_ITEM_ID,MDM_DATA_ITEM_NAME,MDM_DATA_ATTR,MDM_DATA_SEQ_INDEX" +
            " FROM MAP_DDS_MDM_WF WHERE 1=1 AND MDM_DATA_TYPE_ID = #{mdmDataTypeId} ORDER BY MDM_DATA_SEQ_INDEX ASC")
    @ResultType(MapDdsMdmWf.class)
    List<MapDdsMdmWf> getListByTpeId(@Param("mdmDataTypeId") Integer mdmDataTypeId);


    @Select("SELECT MDM_DATA_TYPE_ID, MAX_SEQUENCE FROM MAP_DDS_MDM_DATA_MAX_SEQ")
    @ResultType(Map.class)
    List<Map<String, Integer>> listMdmIdAndMaxSeq();

}
